import ConfigParser

def config_pars(cfg):
	values = {}
	config = ConfigParser.ConfigParser()
	config.readfp(open(cfg))
	url = config.get("baseurl", "url")

	tmp_start = config.get("temperature", "start")
	tmp_num = config.get("temperature", "num")

	dew_start = config.get("dewpoint", "start")
	dew_num = config.get("dewpoint", "num")

	hum_start = config.get("humidity", "start")
	hum_num = config.get("dewpoint", "num")

	win_start = config.get("wind_speed", "start")
	win_num = config.get("dewpoint", "num")

	wing_start = config.get("wind_gust", "start")
	wing_num = config.get("dewpoint", "num")

	cloud_start = config.get("cloudness", "start")
	cloud_num = config.get("dewpoint", "num")

	values["baseurl"] = url

	values["temperature_start"] = tmp_start
	values["temperature_num"] = tmp_num

	values["dewpoint_start"] = dew_start
	values["dewpoint_num"] = dew_num

	values["humidity_start"] = hum_start
	values["humidity_num"] = hum_num

	values["wind_speed_start"] = win_start
	values["wind_speed_num"] = win_num

	values["wind_gust_start"] = wing_start
	values["wind_gust_num"] = wing_num

	return values
	
